home *** CD-ROM | disk | FTP | other *** search
- // editovw.cpp : implementation of the CEditorView class
- //
-
- #include "stdafx.h"
- #include "editor.h"
-
- #include "editodoc.h"
- #include "editovw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView
-
- IMPLEMENT_DYNCREATE(CEditorView, CView)
-
- BEGIN_MESSAGE_MAP(CEditorView, CView)
- //{{AFX_MSG_MAP(CEditorView)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code !
- ON_COMMAND(ID_OLE_INSERT_NEW, OnInsertObject)
- //}}AFX_MSG_MAP
- // Standard printing commands
- ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView construction/destruction
-
- CEditorView::CEditorView()
- {
- // TODO: add construction code here
- }
-
- CEditorView::~CEditorView()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView drawing
-
- void CEditorView::OnDraw(CDC* pDC)
- {
- CEditorDoc* pDoc = GetDocument();
-
- // TODO: add draw code here
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView printing
-
- BOOL CEditorView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
-
- void CEditorView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
-
- void CEditorView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // OLE Client support and commands
-
- BOOL CEditorView::IsSelected(const CObject* pDocItem) const
- {
- // TODO: implement this function that tests for a selected OLE client item
- return FALSE;
- }
-
-
- void CEditorView::OnInsertObject()
- {
- CString strTypeName;
-
- if (!AfxOleInsertDialog(strTypeName))
- return; // no OLE class selected
-
- TRACE("Trying to Insert OLE item with type '%s'\n",
- (const char*)strTypeName);
-
- // TODO: create an embedded OLE object with that class name
- char szT[300];
- wsprintf(szT, "TODO: this function is not completely implemented.\n"
- "You must add code to create a COleClientItem\n"
- " with a type name of '%s'.\n"
- "See CEditorView::OnInsertObject in"
- " EDITOVW.CPP for more info.", (LPCSTR)strTypeName);
- AfxMessageBox(szT);
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView diagnostics
-
- #ifdef _DEBUG
- void CEditorView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CEditorView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CEditorDoc* CEditorView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEditorDoc)));
- return (CEditorDoc*) m_pDocument;
- }
-
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CEditorView message handlers
-